package com.lunwen.lunwen.bean;

import java.util.HashMap;
import java.util.Map;

public class Result {

    public final static Map map = new HashMap();
    static {
        map.put("200","成功");
        map.put("201","失败");
    }

    String code="";
    String message="";
    String type="";
    Object data=null;

    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
        if (map.get(code) != null)
            setMessage(map.get(code).toString());
    }
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
    public Object getData() {
        return data;
    }
    public void setData(Object data) {
        this.data = data;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }

    public void setResult(String code,String message){
        this.code = code;
        this.message = message;
    }

    public void setResult(String code,String message,Object data){
        this.code = code;
        this.message = message;
        this.data = data;
    }
}
